<!DOCTYPE html>
<html lang="en"
	  xmlns:th="http://www.thymeleaf.org"
	  xmlns:sec="http://www.thymeleaf.org/extras/spring-security"
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<div>
    <span sec:authorize="!isAuthenticated()">
        <a th:href="@{/toLogin}">登录</a>
    </span>
	&nbsp;&nbsp;
	<span sec:authorize="isAuthenticated()">
        <a th:href="@{/logout}">注销</a>
    </span>
	&nbsp;&nbsp;
	用户名:<span sec:authentication="name"></span>
</div>
</br>

<h1 align="center">欢迎光临武林秘籍管理系统</h1>
<h2 align="center">游客您好，如果想查看武林秘籍 <a th:href="@{/toLogin}">请登录</a></h2>
<hr>

<div class="menu" sec:authorize="hasRole('ROLE_vip1')" >
	<h3>普通武功秘籍</h3>
	<ul>
		<li><a th:href="@{/level1/1}">罗汉拳</a></li>
		<li><a th:href="@{/level1/2}">武当长拳</a></li>
		<li><a th:href="@{/level1/3}">全真剑法</a></li>
	</ul>
</div>

<div class="menu" sec:authorize="hasRole('ROLE_vip2')">
	<h3>高级武功秘籍</h3>
	<ul>
		<li><a th:href="@{/level2/1}">太极拳</a></li>
		<li><a th:href="@{/level2/2}">七伤拳</a></li>
		<li><a th:href="@{/level2/3}">梯云纵</a></li>
	</ul>
</div>

<div class="menu" sec:authorize="hasRole('ROLE_vip3')">
	<h3>绝世武功秘籍</h3>
	<ul>
		<li><a th:href="@{/level3/1}">葵花宝典</a></li>
		<li><a th:href="@{/level3/2}">龟派气功</a></li>
		<li><a th:href="@{/level3/3}">独孤九剑</a></li>
	</ul>
</div>

</body>
</html>